package com.ccc.boot.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ccc.boot.system.entity.RelRoleResource;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 角色资源中间表 Mapper 接口
 *
 * @author superC
 * @version 0.1.0
 * @date 2022-03-31
 */
@Repository
public interface RelRoleResourceMapper extends BaseMapper<RelRoleResource> {

    List<Long> getMenuIds(@Param("roleId") Long roleId,
                          @Param("type") Integer type);

    int deleteBatch(@Param("roleId") Long roleId,
                    @Param("type") Integer type,
                    @Param("resourceIds") List<Long> resourceIds);

    int insertBatch(@Param("roleId") Long roleId,
                    @Param("type") Integer type,
                    @Param("resourceIds") List<Long> resourceIds);
}
